Patch from Alejandro Piñeiro Iglesias <apinheiro@igalia.com>. Bug
authorLi Yuan <li.yuan@.sun.com>
Wed, 2 Apr 2008 08:29:31 +0000 (08:29 +0000)
committerLi Yuan <liyuan@src.gnome.org>
Wed, 2 Apr 2008 08:29:31 +0000 (08:29 +0000)
2008-04-02  Li Yuan  <li.yuan@.sun.com>

        * gailbutton.c: (idle_do_action):
        Patch from Alejandro Piñeiro Iglesias <apinheiro@igalia.com>.
        Bug #496167. Synthesize press and release GdkEvent in button's click
        action.

svn path=/trunk/; revision=19958

modules/other/gail/ChangeLog
modules/other/gail/gailbutton.c

index 8f3dcd529f7e40511804aedca2782ada9eda722c..993b9f060838160d4b1c20db875e933e08bfbdb0 100644 (file)
@@ -1,3 +1,10 @@
+2008-04-02  Li Yuan  <li.yuan@.sun.com>
+
+       * gailbutton.c: (idle_do_action):
+       Patch from Alejandro Piñeiro Iglesias <apinheiro@igalia.com>.
+       Bug #496167. Synthesize press and release GdkEvent in button's click
+       action.
+
 2008-03-31  Li Yuan  <li.yuan@sun.com>
 
        * gailbutton.c: (gail_button_ref_state_set):
index 64232f5e930bb69035a78afacb2f088e446887bf..dc2e9d5ebd40df4bc8c84d05caca2613e5ede48d 100644 (file)
@@ -522,7 +522,28 @@ idle_do_action (gpointer data)
       switch (action_number)
        {
        case 0:
-         gtk_widget_activate (widget);
+         /* first a press */ 
+
+         button->in_button = TRUE;
+         gtk_button_enter (button);
+         /*
+          * Simulate a button press event. calling gtk_button_pressed() does
+          * not get the job done for a GtkOptionMenu.  
+          */
+         tmp_event.button.type = GDK_BUTTON_PRESS;
+         tmp_event.button.window = widget->window;
+         tmp_event.button.button = 1;
+         tmp_event.button.send_event = TRUE;
+         tmp_event.button.time = GDK_CURRENT_TIME;
+         tmp_event.button.axes = NULL;
+         
+         gtk_widget_event (widget, &tmp_event);
+
+         /* then a release */
+         tmp_event.button.type = GDK_BUTTON_RELEASE;
+         gtk_widget_event (widget, &tmp_event);
+         button->in_button = FALSE;
+         gtk_button_leave (button); 
          break;
        case 1:
          button->in_button = TRUE;